<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      :class="{
        content4: props.info.value && !props.info.remarks && !props.info.subTitle,
        content3: !props.info.value && !props.info.remarks && props.info.subTitle,
        content2: !props.info.value && !props.info.remarks && !props.info.subTitle,
      }"
      class="content outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style15/Level1outlineStyle1Bg.webp'})`,
      }"
    >
      <div
        class="Showroom-parent"
        :class="{ 'Showroom-parent1': route.meta.loopType }"
        v-if="props.info.digitalShowroom"
      >
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div class="title-box">
        <span>{{ props.info.text }}</span>
        <img
          class="title-bg"
          :src="publicUrls + 'free/style15/Level1outlinetitle1Bg.webp'"
          alt=""
        />
      </div>
      <p
        class="subtitle"
        :class="{
          'subtitle-2': !props.info.value,
        }"
        v-if="props.info.subTitle"
      >
        ——{{ props.info.subTitle }}
      </p>

      <div class="remarks1" v-if="props.info.value && props.info.remarks">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="getRemarksNum(4, route.meta.loopType)"
        ></TextMax>
      </div>
      <div
        class="remarks2"
        :class="{
          remarks3: !props.info.subTitle,
        }"
        v-else-if="props.info.remarks"
      >
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="!props.info.subTitle ? getRemarksNum(11, route.meta.loopType) : getRemarksNum(9, route.meta.loopType)"
        ></TextMax>
      </div>
      <div
        class="img-box"
        v-if="props.info.value"
        :style="{
          backgroundImage: `url(${ 
            publicUrls +
            (!props.info.remarks && !props.info.subTitle
              ? 'free/style15/Level1outlinestyle1cover2.webp'
              : 'free/style15/Level1outlinestyle1cover.webp')
          })`,
        }"
      >
        <div class="outline-cover">
          <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free15Style1',
});
</script>   
      
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style15.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax15.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 529px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // box-shadow: 8px 6px 4px 0px rgba(2, 2, 2, 0.1);
  padding: 160px 145px;
  padding-bottom: 64px;
  padding-right: 114px;
}
.content2 {
  padding-top: 371px;
  // .title-box {
  //   margin-top: calc(404px - 159px);
  // }
}
.content3 {
  padding-top: 300px;
  // .title-box {
  //   margin-top: calc(366px - 159px);
  // }
}
.Showroom-parent {
  display: flex;
  position: absolute;
  top: 10px;
  left: 40px;
  z-index: 15;
  width: 44px;
  height: 44px;
}
// .Showroom-parent1 {
//   top: 208.5px;
//   right: 39px;
// }
.title-box {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 300px;
  height: 156px;
  padding: 0 22px;
  padding-bottom: 60px;

  font-family: SourceHanSerifCN-Bold;
  font-size: 32px;
  line-height: 48px;
  text-align: center;
  color: rgba(2, 76, 63, 1);

  span {
    width: 100%;

    text-shadow: 2px 3px 2px rgba(0, 0, 0, 0.3);
  }
  .title-bg {
    position: absolute;
    left: 0px;
    bottom: 0px;
    width: 300px;
    object-fit: contain;
  }
}

.subtitle {
  width: 300px;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  color: rgba(2, 76, 63, 1);
  margin-top: 20px;
  font-family: SourceHanSerifCN;
  margin-top: 14px;
}

.img-box {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 300px;
  height: 162px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    height: 120px;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 240px;
      max-height: 100%;
      height: auto;

      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.content4 {
  padding-top: 160px;
  .img-box {
    margin-top: 20px;
    height: 362px;
    .outline-cover {
      height: 320px;
      overflow: hidden;
    }
  }
}
.remarks1 {
  width: 300px;
  margin-top: 16px;
}
.remarks2 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 300px;
  height: 288px;
  margin-top: 16px;
}
.remarks3 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 300px;
  height: 352px;
  margin-top: 16px;
}
</style>
